import 'package:base_plugin/base_plugin.dart';
import 'package:finance_app/generated/a.dart';
import 'package:finance_app/generated/l10n.dart';
import 'package:finance_app/src/common/app_colors.dart';
import 'package:flutter/material.dart';
import 'package:flutter_svg/svg.dart';

class FilterButton extends StatelessWidget {
  final VoidCallback onPressed;
  final double horizontalPadding;

  const FilterButton({Key key, this.onPressed, this.horizontalPadding})
      : super(key: key);

  @override
  Widget build(BuildContext context) {
    return PressedOpacityButton(
      onPressed: onPressed,
      padding: EdgeInsets.symmetric(
        horizontal: horizontalPadding ?? getDp(20),
      ),
      child: Row(
        mainAxisSize: MainAxisSize.min,
        mainAxisAlignment: MainAxisAlignment.center,
        children: [
          SvgPicture.asset(
            A.assetsImagesDashboardFilter,
            width: getDp(15),
            height: getDp(15),
          ),
          SizedBox(
            width: getDp(10),
          ),
          Text(
            S.current.filter,
            style: TextStyle(
              color: aceBlueColor,
              fontSize: getSp(16),
              fontWeight: FontWeight.w700,
              height: 1,
            ),
          )
        ],
      ),
    );
  }
}
